package com.ruoyi.ruoyiqywechat.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ruoyiqywechat.mapper.UserPrivilegeUsageMapper;
import com.ruoyi.ruoyiqywechat.domain.UserPrivilegeUsage;
import com.ruoyi.ruoyiqywechat.service.IUserPrivilegeUsageService;

/**
 * 用户权益使用记录Service业务层处理
 * 
 * @author 好六
 * @date 2025-10-10
 */
@Service
public class UserPrivilegeUsageServiceImpl implements IUserPrivilegeUsageService 
{
    @Autowired
    private UserPrivilegeUsageMapper userPrivilegeUsageMapper;

    /**
     * 查询用户权益使用记录
     * 
     * @param id 用户权益使用记录主键
     * @return 用户权益使用记录
     */
    @Override
    public UserPrivilegeUsage selectUserPrivilegeUsageById(Long id)
    {
        return userPrivilegeUsageMapper.selectUserPrivilegeUsageById(id);
    }

    /**
     * 查询用户权益使用记录列表
     * 
     * @param userPrivilegeUsage 用户权益使用记录
     * @return 用户权益使用记录
     */
    @Override
    public List<UserPrivilegeUsage> selectUserPrivilegeUsageList(UserPrivilegeUsage userPrivilegeUsage)
    {
        return userPrivilegeUsageMapper.selectUserPrivilegeUsageList(userPrivilegeUsage);
    }

    /**
     * 新增用户权益使用记录
     * 
     * @param userPrivilegeUsage 用户权益使用记录
     * @return 结果
     */
    @Override
    public int insertUserPrivilegeUsage(UserPrivilegeUsage userPrivilegeUsage)
    {
        userPrivilegeUsage.setCreateTime(DateUtils.getNowDate());
        return userPrivilegeUsageMapper.insertUserPrivilegeUsage(userPrivilegeUsage);
    }

    /**
     * 修改用户权益使用记录
     * 
     * @param userPrivilegeUsage 用户权益使用记录
     * @return 结果
     */
    @Override
    public int updateUserPrivilegeUsage(UserPrivilegeUsage userPrivilegeUsage)
    {
        userPrivilegeUsage.setUpdateTime(DateUtils.getNowDate());
        return userPrivilegeUsageMapper.updateUserPrivilegeUsage(userPrivilegeUsage);
    }

    /**
     * 批量删除用户权益使用记录
     * 
     * @param ids 需要删除的用户权益使用记录主键
     * @return 结果
     */
    @Override
    public int deleteUserPrivilegeUsageByIds(Long[] ids)
    {
        return userPrivilegeUsageMapper.deleteUserPrivilegeUsageByIds(ids);
    }

    /**
     * 删除用户权益使用记录信息
     * 
     * @param id 用户权益使用记录主键
     * @return 结果
     */
    @Override
    public int deleteUserPrivilegeUsageById(Long id)
    {
        return userPrivilegeUsageMapper.deleteUserPrivilegeUsageById(id);
    }
}
